<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%--
  Created by IntelliJ IDEA.
  User: 123
  Date: 2020/11/1
  Time: 9:48
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
</head>
<body>
<table border="2px"  align="center">
    <tr>
        <form action="${pageContext.request.contextPath}/Product/Product_page" method="post">
        <td colspan="7">排序方式:
            <select name="where">
                <option value="1">销售日期</option>
                <option value="2">单笔总价</option>
            </select>
            <input type="submit" value="提交" align="center" >
    </form>
        </td>
    </tr>
    <tr>
        <td>ID</td>
        <td>商品</td>
        <td>单价</td>
        <td>数量</td>
        <td>总价</td>
        <td>销售日期</td>
        <td>售货员</td>
    </tr>
    <c:if test="${page.list==null}" >
        暂时没有销售记录
    </c:if>
    <c:if test="${page.list!=null}" >
    <c:forEach items="${page.list}" var="d">
        <tr>
            <td>${d.id}</td>
            <td>${d.p.productName}</td>
            <td>${d.price}</td>
            <td>${d.quantity}</td>
            <td>${d.totalPrice}</td>
            <td>${d.saleDate}</td>
            <td>${d.u.userName}</td>
        </tr>
    </c:forEach>
    </c:if>
    <tr>
        <td>
            <c:if test="${page.isFirstPage==true}">
                首页
            </c:if>
            <c:if test="${page.hasNextPage==false}">
                <a href="${pageContext.request.contextPath}/Product/Product_page?pageIndex=${page.prePage}">上一页</a>
            </c:if>
        </td>
        <td>
            <c:if test="${page.isLastPage==true}">
                末页
            </c:if>
            <c:if test="${page.hasPreviousPage==false}">
                <a href="${pageContext.request.contextPath}/Product/Product_page?pageIndex=${page.nextPage}">下一页</a>
            </c:if>
        </td>
    </tr>
</table>
</body>
</html>
